building function , from the inside