corrected computation for boundary vertices.