little optimisation, gained 2 or 3 fps