First working version. Or maybe not.