WIP, partially compiles now with rework