Made changes requested by yellis for readability and code cleanliness.