Optimisations completed - 3 less variables in 2 functions