Refactored to make a test mode, with configurable strings for input.