First Version

Function has not worked (but neither the vector version presented as an
example)