Added entitySorting to get overlap right