Passes basic test case. Needs docs.