stack to keep track of current position