Add zero distance optimisation
Add comments