finish version with sort