Cleaned up; added more output; added comments