A Method of generating initial conditions for cosmological N body simulations