Added recursive function using rec keyword
Using Head and Tail in the Collections.List
Define generic variables/functions