Modified to use std::bitset