Made init_matrix function and added a comment