Add random number function; Add print function for matrix

- Fixed other general errors