add tests around invalid hands and frames, cleanup matrix + vector use