Update functions.php

Updated a few functions, formatting changes