program to insert nodes in a sorted format, also fixed minor bugs in stack programs