constructing X

got the right ordering for the indices
the update of the first pair is done

the rest should be similar. Now going to move the 'construct_double_layer' functions
to the Environment class because that is where they belong.