Add closeLine function for csv function and close line after each algorithm