Tidied code some more