When I click on the link, it won’t preview the code, so in order to view it, I need to download the file, then create a directory with the same name and then move the file to that directory and THEN look at the code (in the Arduino IDE). It would be much easier for everyone if you posted it to http://gist.github.com. That way, we can have a quick look and see if we can help from there.
Sorry, we get so many requests for support and have had to mention that to folks. When I saw you mention ‘it goes random’ above, it looked like a request for support.