use bitwise operations to implement all algorithms
apply AStyle coding style