fixed len method by adding a size field to the Graph type