Tidied code and removed spurious comments.