Tidied code
Removed test code from master