diagonal matrix size check overrides
tidy
innerProduct optimisation and refactoring
kill redundant code
misc refactoring