It took almost half an hour to get this problem solved because the OP named their functions and variables poorly. Naming proved itself so important in this case I had to rename pretty much everything when trying to solve the problem so I didn't get lost.
After getting the problem solved I had no idea if I should implement the solution to the poorly named code or to answer using the highly modified version I had made to work on. After all, the real problem does not lie on naming and, as far as I know, we should try to preserve OP's coding style as much as possible.
Stack Overflow is not Code Review, so I want to know if is it okay to rename everything for the OP, or should we always leave this job to them (or Code Review)?