completed version of program