Adding map function + tests