moved all functions to respective files, all called from head.php