removed redundant if test
added unstemmed term as another base case (in which the input is returned unchanged)