Added functionality to the Entity class