Update functions.hs

Updated and1 functionality to proper specification