Added xdel,ydel,sdel,hdel as output arguments to allow for non-binary variables (s,x,y,h)