added comparison code