changed operator ^ to % for Rex