A little more refactoring. Let the calPrice function handle the ugly logic!