fixed table generation in searchToken() and wrote a draft function to remove \r in windows output