printing uses ascending order