Compare elements for assignment 6