Update connectionlib.py

Working and fixing the base.