re-implementing drawGraph in pygame