Best deal sorting:
This is a function that will sort an array with integer keys (weight) and float values (cost) and delete 'bad deals' - entries that are more costly than other entries that have greater or equal weight.
Input: an array of unsorted weight/cost pairs
Output: none
function BEST_DEALS($myarray)
{ // most weight for least cost:
//