work in progress, still adding how to find correct indices