reworking prevWord function to use new decoder.currentIndex variable
refactoring prevWord function
refactoring prevWord function