added some code to shortest