added SELECT to query fcn, fixed FROM