added atoi and sorting a stack