using switch single node function