Added doctests on count
Added flatmap, lookup methods along with doctests.