updated io to take optionally take a table for value mappings so I can use it externally