Cleaned up file and added comments.