Factored out modulus
Remove previous code
Remove unused packages