> > p4=: 1 :(':';'({:y)+6%~+/1 2 2 1*(x*[: u y+(*x&,@{:))/\.1 0.5 0.5,x*u y')
should be: p4=: 1 :(':';'({:y)+6%~+/1 2 2 1*(x*[: u y+(*x&,))/\.1 0.5 0.5,x*u y') (*x&,@{:) was used in an earlier attempt with an accumulating fold. It can be simplified (because of using the faster scan fold) to (*x&,) ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm