Added basic functionality to switch layers