refactored most code
ditched EJML, decided to go with fully custom implementation