Added new config file and changed some code for stability