modified from sukumar PC
resloved conflict