some improvements for graphs