Change functions to Functions.class.php; Further improvements