Add functionality to write tags too, untested