Fixed generation algorithm for asc and desc
Refactoring in plotter