updates program by deleting end