Modified entity.py