optimize board shape