added algorithm to remove underscores