Tidied code

Tidied code