Made time_window an optional argument.