Read m and n
Refactor line parsing
Refactor read-numbers