removed the scrap and small modifications in js