Small improvements that gives a speeup of 1.77 times