implemented HalfAdder