Update js to do calculation, return results