Added board size check and fixed header inclusion.