#21 started some refactoring. uses intended indices