Update modulation.py

just some refactoring