Removed determining type. still need to handle negative values and costs