changed array of shapes to JSON object