Cleaned up code format and added in comments.