Currently, I hand implemented the n=2 m=1 case but I feel it should be possible for a generic implementation.