fixed up the n variable