added board updating logic to js