Very basic path closing and detection