commented, edited
function getPieces now works. removed debugging crap