Added outputStack method to output the stack without changing its values while also outputting the goal and index values at the current time.