Working code

At least it compiles now