commented and formallized connection.py