Added comments and final polish