improvement in the way the end arc is calculated

Signed-off-by: Ruben Mendez <ruben.mendez@gmail.com>