Updated duplicateBoard function to utilise the already existing traverseBoard function