JK function fixed