Calculates comission based on input