what is the for function for in this program