defining procedures
define procedure that returns median
print out a countdown
return last position where target string appears in search string