adding some functions in Chap4 "Searching and ranking"