Modified code for graphic objects