Added logical AND fuction.