lf_functions.php cleaned