code cleanup: use logical and instead of bit and, bug fix in is_equal
code cleanup: remove code without effect