removed use of java7 Integer.compare