Added documentation + fixed test