Coding the loadLevel function