Started to fix structure of program to better match the documentation.