fix random selection cost calculation