Created next_op function to search next operator with brackets