added agent functionality