vertical <=> horizontal switching added.