Well, if you code it.
Then it's very strange that you don't know the problem to it.
And I am almost sure we can't help unless you give us source or snippet of the drawing / aim function(s).
Just saying that it's strange that you made it and have the same problem as the thread below you...