switched to -O2 optimization