Added switch functionality[Untested]