changed mod from % to mod