added compare functions exercise 2