changes default n; fixed minor bugs