Merged Code and added Settings