add while loop to choose the first position