flattened boxes and fixed tests for convenience