some tests added, function body inlined