changed SQL again, temporary testing for JOINs