Currently compiles, further bugs probably present