first version that's usable
some clean-up