implemented query.count();closes #50