streamlined coeffgen function by using column vectors as keys instead of 2xD matrices