now handles multiple graphs (strings)