Added boundary function