Level change function

Level change code implementation in the index file