Cellular Automoton in JavaScript