added stack sorting algorithm