How to worl with bitwise operations