fixed a minor bug where factor length was fixed at 6 rather than length(facLevels)