improved documentation & added a test