Fixed up the errors after merging code. Makes and runs, have not tested output yet