The present invention provides compounds of the formula I, wherein X is a bond or CH2; Q is CH2 or O; L is selected from the group consisting of —OCH2— and —CH2O—; or a pharmaceutically acceptable salt thereof. Compounds of the invention are autotaxin inhibitors.