Initial fully working version.