Initial working version, sort of