week 4 function stuff