Remade board drawing logic to get rid of nested loop.