Question: Zebra RW 420 not printing last or first inch(depending on rotation) using ZPL.

this [link](https://km.zebra.com/kb/index?page=answeropen&type=open&searchid=1419108861970&answerid=16777221&iqaction=5&url=https%3A%2F%2Fkm.zebra.com%2Fkb%2Findex%3Fpage%3Dcontent%26id%3DSO7036%26actp%3Dsearch%26viewlocale%3Den_US&highlightinfo=6292248,11,20#) was suppose to give a solution since it is the same symptom; but I've try all combinations of "Back Feed" (~JSN, ~JSA, ~JSB) with no results.

here is my ZPL code(generated from ZebraDesigner print to file command) It doesn't print "Hello 22" completely:

```
^XA~TA000~JSN^LT0^MNM^MTT^POI^PMN^LH0,0^JMA^PR2,2~SD10^JUS^LRN^CI0^XZ
^XA
^MMT
^PW812
^LL2233
^LS0

^FO272,76^A0N,56,55^FH\^FDHello 11^FS
^FO320,2000^A0N,56,55^FH\^FDHello 22^FS

^PQ1,0,1,Y^XZ

```

Answer: 
I belive that a `PriorityQueue` could replace most of your code. Check out [the JavaDocs](http://docs.oracle.com/javase/7/docs/api/java/util/PriorityQueue.html).

> 
> The elements of the priority queue are ordered according to their natural ordering, or by a Comparator provided at queue construction time, depending on which constructor is used.
> 
> 
> 

So, if `ElementType` implements `Comparable<ElementType>` or if you provide a `Comparator<ElementType>` you should be all set.
As wasgren points out, this code is redundant with PriorityQueue. Perhaps you're doing this to learn about linked lists, though...

This code doesn't work because you aren't correctly linking up `elem` in your last case (the chunk of code just before the second last close brace).

Try adding this to the end of that chunk, just before those close braces:

```
elem.prev.next = elem;

```