implemented list-size using lambda and foldr