Documentation

Add some documentation to the existing code.