Added or, and bit macros and cleaned up code