implemented bankruptcy and added agent logger