adding the same structure for storing graph