implemented switch actor
added test cases