Cleaned up getDependency to return IndexedWord