completing 3d program as per new flow jonathan pointed out