completed fixed queries; check boundaries, and fixed 4