Added some comments, cleaned up script.