Add some documentation, change silly function name.
Add licence etc.