Moved wordsPerMinute to a setting and time calculation to a function