loop/recur version of fapply