changed most matrixes from int to boolean for better memory footprint