implemented proper fix for exchange issue / added tests.py
implemented proper fix for exchange issue / added tests.py