Almost working version (for tests).