edited base.py