binary search implemented to be used for finding current/prev/next activities