Solution mechanism updated, tests added, error for non-arrays added.