Re-wrote write function; updated ._search function for raw output.