Added binary test
Fixed computation of array length in html code