adding some linear algebra