fully implemented searchForFreeSlots. Allows searching for free slots
and taking it