Code

Use provided threshold functions (no functionnal change apart the check for overlapin...