refactored add

- moved condition for checking for free slots into a method called
querySlots(Task task)