Implemented noll's ordering scheme and tried to improve performance