Tidied up README, code comments and re-organised code