fixed, tests added