added var declaration to n