dropped spurious semi-colon and add stackToJSON