minor changes in code for readability