Implementing the switching behavior as per the readme file.