added modulus
refactor into smaller methods
passed 2 tests