cost matrix construction expanded :jack_o_lantern:

going in the right direction