CS2: Manual modulus function