added method to return a slice of a matrix