Removed unnecessary class
Changed tag stack from array to SplStack