Updated functions.php with new tables