cleaned up logic. added time logic
TimeLogic implemented