sorting stack, first try