finished backend for shorting