moved first check of ident to after witing
added some comments, simplified DataCache