incorporate new bt_deletekey code to file I/O version