add building function