Working LIA
Modified REAR to display output suitable for SORT