decided on key structure, now writing update mechanism