LIFO priority sort
corrected some mistakes
options final touches