Modified core-lib.php, added documentations