Finished cmp_patron function