added graphic functions