Added N calculation
I don't know what is happening