implemented sorting agenda