clean up and make settings work