additional formatting and renamed a variable to make it clearer what it does