implemented shortening for both cases