fixed code in displaylast

logic was wrong so a more simple swap was needed to be written.