building function explaination