Removed unused declarations
Changed time check to start and end only