Implemented map function using block as parameter (Ex5.2).