adding some rule-based stuff