minor changes to make the code consistent in style and more readable.