anchor.diff:          end forall
       end function
   
  -    function contains_p (a, p) result(b)
  -        integer, intent(in) :: a(:, :, :, :)
  -        integer, intent(in) :: p(:, :)
  -        logical             :: b
  -        integer             :: i, j
  -
  -        loop: do i = 1, size(a, 4)
  +    function contains_p (ps, p) result(b)
  +        type(list), intent(in) :: ps
  +        integer, intent(in)    :: p(:, :)
  +        logical                :: b
  +        integer                :: i, j
  +
  +        loop: do i = 1, ps%length
               do j = 1, size(p, 2)
  -                if (a(p(1, j), p(2, j), p(3, j), i) == 0) then
  +                if (ps%d(p(1, j), p(2, j), p(3, j), i) == 0) then
                       cycle loop
                   end if
               end do
  
positive.code: 
      integer, parameter   :: isin(0:3) = (/ 0, 1,  0, -1 /), &
                              icos(0:3) = (/ 1, 0, -1,  0 /)
      integer              :: mrot(3, 3, 3, 4)
      integer, allocatable :: vecs(:, :, :)
      type(list)           :: rots
      integer              :: ii
  
      call init_mrot(mrot)
      call read_pieces(vecs)
      call print_pieces(vecs)
  
      rots = all_rots(vecs(:, :, 1))
      print *, rots%length
      do ii = 1, rots%length
          call print_pieces(rots%d(:, :, :, ii))
      end do
  contains
      subroutine init_mrot(mrot)
          integer, intent(inout) :: mrot(3, 3, 3, 4)
  
negative.code:         integer             :: i, j, k
  
          ps%length = 0
          allocate(ps%s(size(p, 1), size(p, 2), 4**3))
          allocate(ps%d(3, 3, 3, 4**3))
  
          p1 = p
  