Added bitwise operations instead of arrays