new arrayfun + small corrections