finalized matrix calcs, still need mesh calcs