some small improvements - still in a mess