improved tests and addition of plotting functions for matrices