fixed bit vector stuff, need to make case for already existing and resource table