Small changes - need review, I think
Calculate the dimension of vector valued mf for k=2, i.e. incorporate the code for the invariants. Doesn't work right now.