def _WPM_calculate(wordcount, duration):
    """Calculate words per minute given a word count and duration."""
    if duration <= 60.0:
        frac_dur = duration/60.0
        WPM = wordcount/frac_dur
        return WPM
    elif duration > 60.0:
        frac_dur = 60.0/duration
        WPM = frac_dur*wordcount
        return WPM