Modified write mwthods, but they are still bad and need revision.