Exact solutions for the nonlinear Schrödinger equation with power law nonlinearity