function to calculate initial position of the board