Bug fixes

Compiles and runs now