You did this different above, you stored l back into locations after modifiying it. Did you not need to do that above, or did you make a mistake here?