GSOC 2012 - work done by Peter