added f(v) output and some error messages. HS