ripping out active record and writing/reading to file instead