Added UI, bounds-checking for input, Matrix class