renamed variables and reformatted indentation