not good enough to uncomment yet, but some progress
it compiles with more stuff uncommented