Adding two functions - Removing duplicates && Finding nth to last element