Added base case so it doesn't freak out on empty lists.