Added more code to the Entity.