Completed the Logic Gates implementation