improved formatting of code for readability