fix issue #8 : use python bisect module