change codes to output better graph