Implemented write_data & write_string.