This disclosure relates to compounds for the inhibition of histone deacetylase and treatment of a cognitive disorder or deficit. More particularly, the disclosure provides for compounds of formula (I)whereinQ, J, L and Z are as defined in the specification.