fixing docstring (thanks @jerith)
Raise ValueError if invalid direction received (thanks @jerith)