updating mapsets algorithm