Removed testing code and added some documentation.