added comments, cleanup code