created basic rules and logic and tests for it. Fixes #3.