Remove C-Style arrays and add assert statements for testing canonical form