Corrected variable name in for-loop -> "sub_step".