implements getIndex, works on fixing insertItem