Head and Tail program modified with return value from function
Uniq ang reduce space program modified with return value from function