Latest Code till 21/11/2013

Includes new functionalities as well as earlier bug fixes.