Fixed z bit collection bug. Still incorrect output