added switching between layers