more documented, test added.