added cleanup for n