Formatting again. I'm also not very fond of the return statement hidden under two ifs, I'd rather we used two flags or we called addAffectedKey/addAffectedKeys all the time.