added map function
minor changes