Finishes the program