You don't want `total` to be the sum, but the bitwise-or.

```bash
total = total | the_map[lvl];
```