added save/load settings feature. Fixed minor bugs.