Refactored nominal and ordinal code, added plot function for ordinal