added advanced keyfile stuff