modification done by saptarshi dey sarkar