coercion types, and exercise 2.81, 2.82 solved
sample code of 2.5.3