some js changes. and js calcuation