added overlapTasks function