matrix class can be made more generic. 1. extract an interface and have a default implementation. 2. support sparse /band matrices