Adding Sort Direction and Unit Tests.