StackSort implemented