Added initial logic to connection.py.