adding filter methods to Matrix.scala