rewrite foreach with for
params check in add($row)
tests for add($row)