current state, lots of compilation fixes + restructuring