fixed run_length to work, added gotcha comments, and changed index to i to easily compare with alternative solution