fixed major flaws, compiles and runs again