added more comments to help make the code more sensible; deleted unnecessary comments from top of file