cleanup code
reformating source code
correct bitwise AND to bool conversion