wip; using pre-calculated indices