Making changes in addObjFigure functions to make it work