Added an implementation of mapsum