refactored vector<bool> and stack<T>