Updated Layout with Javascript array