Working on start and end detection