Tidied code again