n needs to be int