added source code taken by soumen da