Added spg code