minor readability fixes. logic unchanged