fixing an unitialised n bug (again!)