completely refactored how working with bitmasks work