problems with bitmasking solved