remove var_dumps, make query more efficient