that give you a idea how it works so you can make your own, remember to add the rest to your equations, i tryed to keep it simple for you, as how i started my equation in petit computer, now with smilebasic you sould be able to make it a function to call on.