added a small helper method
improved the documentation and formatting