added via point algorithm