Assignment 2: Bit Ops and Debugging solution