re-arranging method order for clarity, reformatting code, renaming variables