Add max to kai_q

@aerosol please review/merge