fixed link to figure and removed redundant code