First try at fitting all functions