added basic time ended function