added Settings,
Cleaned code