updated the code to match final board, fixed parsing and scope errors