Adding working version with testsuite.