Minor changes to code, added settings