Tested and fixed the function extraction, now it works