Replaced type of pieces and positions with define. Replaced function arguments with pointer equivelents.