modified wordnet to check for an edge case where a path is found that is not the shortest. also threw exceptions as directed.