added interfaces and compareTo()