sort instances