All tests passing but some improvements to make
Optimisations