added level switching