i started to write helper methods and the compareTo(rule) method