Tidied Pull Request #18 code a little