Using map instead of update