function.php reworked. This will be important for later