draw graph in proper way