fixed some errors and got the program to compile at this stage. not complete yet