updated comments
attempt to implement map function and added comments