Added more functions to manipulate matrices (2d arrays)