Made the configuration saveable, as well is made some of the logic more robust