Implemented write file as well as format commands