The for loop seems a bit strange-- I assume there is only ever one step_hash? How would it work if there are multiple?