lot of fiddling and improvements