Cleaned up in code, and fixed several issues pointed out in the review.