If you don't post some code we cannot help you.
I guess there is a problem with the c_trace however I'd like to see the gravity part of your script.
So please post it here and we might be able to help you.