added previousN setting and use of default settings