Implementing levelstate saving