Implemented shorten. Closes #4.