started to implement query to find all intervals in a time slot