Add some documentation and const qualifier