Debugged Emporium code