zindex sorting and entity ids and testing