Moved functions to functions.php