The Nonlinear Schrodinger equation with a potential in dimension 1