Stack linked list implementation (number system conversion problem)