basic code for the price point problem