Code cleanup; Added additional comments