javascript changes to get equations