Removed use of vectors for keeping track of active flags