modified map javascript