Added two diff versions:diff1 taking values array,diff2 taking x & y arrays