It sucks that N can't be an int. I wonder if there are best practices around this sort of thing