Everything compiles, but calcTargets is still wrong.

Implemented calcIndex, tests pass.