Moving element horizontally on scroll

Trying to scroll an element horizontally right off the screen as the page scrolls down. I’d also like to be able to scroll back up and have the element be in the original position.

I’m having trouble getting the speed and reverse scroll to work just right. Any ideas what I can do?

$(document).ready(function () {
    var $horizontal = $('.horizontal');
    var startPosition = $horizontal.position();
    var speed = 14;
    var lastScrollTop = 0;
    i=0 
    $(window).scroll(function () {
         
        var st = $(this).scrollTop();
         if (st > lastScrollTop){
             // downscroll code
           i++;
         } else {
            // upscroll code
           i--;
         }
         lastScrollTop = st;
        
        newPos = startPosition.left+(i*speed)
        
        $horizontal.css({
            'left': newPos
        });
    });
});
.container {
  min-height: 50000px;
  width: 100%;
  overflow: hidden;
}
.horizontal {
    position: fixed;
    width: 50px;
    background: url(http://www.pngpix.com/wp-content/uploads/2016/06/PNGPIX-COM-Renault-Megane-RS-Trophy-White-Car-PNG-Image.png) no-repeat center center;
    background-size: cover;
    width: 500px;
    height: 200px;
    left: 50%;
    top: 50px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="container">
   <div class="horizontal">
     
  </div>
</div>


Simply add the start position to current scrollTop

Edited to include speed