shit is still seriously broken - rewriting to debug