improving and speeding up JES implementation