Added working version with tests.