Final Update

Added comments, fixed up code/tidied up a bit.