converted update to use map