some more of the bug fixing