restoration not working yet, but fixed a few other things