some fiddling and simplification