Cleaned up functions.inc.php