implemented write fully