Problems with making a function

You need a } on line 39 to mark the end of the loop() function.

Every { must have a corresponding }

...R