yet more improvements/bug fixing