better implementation + better docs