Merge pull request #378 from subvertallchris/query

first and last class methods