added jp_middle and fixed jp_size