Added -O2 optimization