Nested some switch statements and stuff.