Fixed style and added documentation.