Created stack structure for tracking commands and 'current' nodes