pricing algorithm