Added CPP Loop and Write Data to Txt File