ex3 'and' function