Revised functions.php to be readable