working on javascript for map