Q: sunroof does not open/close properly on 2005 Nissan Maxima

Rookie cbe0621eac06868b3efe0d8d1d3611e23c60d3114864ea2ec19a68cfbd3eebab
Sunroof has two switches. Switch to open/close does not work. Switch to tilt works to tilt and open/close, but when you close roof stops every inch or so and you have to press the switch again for another inch of travel. When finally does close, sunroof does not line line up evenly with rest of roof. Body shop told me sunroofs are complicated and probably need to replace the whole sunroof. If anyone can say this is merely a bad switch with reasonable certainty, I'd appreciate it and will replace the switches.
(1) Answer
if you have a batt problem or remove batt with out saving set must reset this by tilt up ,tilt down ,open ,close you must keep pushing open and close till it is opened all the way then closed all the way.turn switch off wait 10 sec then try just open a little at a time then close then try full open.that is what repair man said it worked for me.