Text this: A novel procedure for constructing invariant subspaces of a set of matrices