added reading input from file to ReverseDomain