Add jquery function to compute result