Refactored and documented functions.html.