rewrote jump logic