implemented saving code, added some name functions in ContactEntity