boundary function is finshed