Added and, or and xor functions