Added code for levels