Adds a function to get every nth element of a list