Optimal Reinsurance Wtih General Risk Functions