Matrix inversion fix + bucket preprocess seperation