made note_from_period use a binary search