changed drawGraph