give the function names for the implementations of these two stages.