- implemented saving function for levels.