modify arc calculation algorithm