Update for testing mass optimization
Compiles but untested..