Shortened & removed possible errors

1. Shortened the input of the matrices by using for loops. (This also enables the use of larger matrices).
2. The program now checks to see if detA = 0, if it does then stop the program as it will cause an error, otherwise continue.
Merge pull request #1 from dwlk/patch-1

Shortened & removed possible errors