Everything is now recorded onto a .txt file and it works properly