code refactoring,
row solver logic adjusted
tests added