sorted vanilla version