Documented code and fixed warnings.