Added functions, replaced parts of curl