Cleaned up code and added two comments.