fixed write_type_lines to be more general
realised string length conversion done so deleted its duplicate
changed write_use_lines to use type