created map function