a few bug fixes, a shitload more to fix still