added function to check if two expressions are equal