tidied up a few last comments, removed redundant variables