finished start-end logic