added nscoding implementation