implement greater and less