Creating functions and updateing base.php