enabled optimisation and silenced some warnings