Working: added the divide method to matrix.h, and fix bugs.