A few more tweeks and extensions

still need tests.