Have a question about CiviCRM? Get it answered quickly at the new CiviCRM Stack Exchange Q+A siteThis forum was archived on 25 November 2017. Learn more.How to get involved.What to do if you think you've found a bug.
You are welcome to look at the code
You are welcome to look at the code, but much of it will not be applicable to your situation. However I think the general approach works quite well. I recommend it