Refactored, Compiles now