made js more accurate
removed unused code