Highest Write Wins flag, register, map and set

*Only for discussion not finished yet*

perhaps slightly more efficient to use `match`?