Added Matrix class and random generation function