Added some comments and removed a debug print statement.