Enabled optimizations

Enabling -O2 speeds up performance considerably