updated with comparable and comparator