Filling the two functions