close to first version
working through it...