Implemented toLocal for more input data types