Added more comments to the code and trimmed down the blubber.