Ok, I think I got the algorithm. What I need now is to add the pic some basic real number calculus and everything will be fine.. Thanks! ~Vicktor