work done for 2009 GSoC project