Working version of program