made some preliminary codeo n sortIndex - may need some change in thinkingp