Revert "Removed acceidentally inserted type signature"

This reverts commit c04bf8272b714171d288f54201216b3ae4c5411e.
Revert "Simplify the index function"

This reverts commit 775eeaab06e03119effce1409fd76df65e15b4d1.