implement rules, has bugs