Implemented saving to config, minor changes