Maytag will not spin

I have a maytag centennial washer that will run through the entire cycle but does not always spin. It will drain and if I open the lid and close it back it will start spinning. I have replaced the timer and lid switch with no results. What else can I do?