function [value,isterminal,direction] = OutOfSpace(t,X)
eps=0.1;
value = [X(1)+eps;X(2)+eps;1-X(1)-X(2)+eps;1-X(1)-eps;1-X(2)-eps;X(1)+X(2)-eps];
isterminal = ones(6,1);
direction = zeros(6,1);