adding function count_all in u.lua