Revert "Revert "Revert "Added writing end reading from file"""

This reverts commit 3c4262916cac90348ad3465f8804e3a7cdf41aa7.