sort out code