why is my function not outputting anything