[some modification of Madhusudan 07_sep_13]