Add a calc_raise_percent function to get the raise percentage and refactor