Flat file keys function and test