all rules implemented plus tests