fix pricing algorithm