compute J
last problem