final code
24 july 2013----