This is a code that describes TCT cycle algorithm, the first method is by using a thread, i don't know why i should use the unimportant thread in the past. However, this is the newest and improved code.
http://pastebin.com/raw.php?i=ZgLh7k7A
PS. I wrote these without the fucking smokes, what a progress.