added comments and removed some verbose output