added previousN setting and use of default settings
ammend fix