Exercise 5.6: Implemented map, filter and toString.