Is there a question hidden in there someplace?

We're not going to copy, compile and debug your code for you... that's your job.

That said...
All the function calls in your switch() statement...