added settings and a small clean up