previous problem with mod operation