moved main to top, compile with optimisation
individual options for main