comments left for better understanding and calls to writeToDisk method added in main do-while loop