hey thanks for replying and sorry for double posting, i thought the original one did not go through hence the double post and idk how to delete the other one 😢.
anyway as for the context on why i want to make it it own function is because it cluttering my main function as I have 2 other files I need data from so I thought it best to put it into a function , maybe make a header file and go from there .