Inital workings for sorting