make n a local variable to fix name clash