changed Release build optimization to -O2 from -O3 due to -O3 causing bugs