Cleaning up functions and calling from main.rs
Cleaning up functions and calling looping from main.rs
Cleaning up functions and calling write_to_file from main.rs