implemented automatic detection of input matrix size
Added optimisation functions in new files.  Currently runs correctly on first pass of simpleSSA(), then gets stuck on second pass. investigate further