added comments, removed vestigial code