avg word function completed. More tests needed