fixed error in how array access was calculated (now actually
works correctly lol)