Update shorten.py

Excelent updates, vry quality, see comments.