refactored, added time slot generation for a given window