now works for single table queries. Join queries om multiple tables not so much :(