Implemented a tradeoff function