fixed by 0-index bug, have a new bug: probably shifting incorrectly, might need help with this one...