First possibly working version.