Changed get_initial_n function so it is responsive to kappa