got it to compile on Mac, removed ptrs where possible, but lots of optimization/bugfixing still needed