added code for the size of n