Converted postfix to use LinkedList