Added padding to predict_idx.
Renamed round_up_to_blocksize to reflect the fact it rounds up.
Checked the K_x test part, the test is incorrect.