Changed impl to use LinkedList instead of java.util.Stack