refactored solver so array args should work
mountain of hacks, matrix set routine is nasty but it woiks