more attempts at optimisation