updates to flatfiles codes, WIP