Added a tested map function