start developing algorithm for write files to database