Cleaning and Comments

Cleaned testing code a bit, and added comments to document