added sorting / removing duplicates / input shell