fixed bug where we were skipping the last step due to bad index math