Changed the file_exists function. Added basic lib management.