Revert "Added writing end reading from file"

This reverts commit 2ff566fe2d114bcd4bfe54dc6ce6bbdbed3a35f9.
Revert "Revert "Added writing end reading from file""

This reverts commit 96845701b985d82ecc8f6a0f9bf9a1efc619712f.