adding implementation of interchange
adding interchange functionality
Working version of interchange