Initial draft - compiles and somehow works