Create code for sorting