wrote map functions