bug in RG fixed, added drawing of graph