Image Guide
That looks like two degrees of freedom with two servos. Do you have them linked together?
Code on paper cannot be proved to be wrong. Try writing it as an Arduino sketch and insert it into your reply with [ code ] tags. Read the post on how to use this forum.