script for part 3 with word to class function