Update contacts.py

Fixed so that criteria would only be one cell
Refactored to be more functions