c++ 30% speedup
added compiler optimizations for c++, slight speedup