code tidied...