added key-function
edited rainbow.py