added a test, thanks Jonathan