apply rules
working