added bitmasking