Made function to produce text on buttons, made for loop to get index of data line a button click will change