rules and facts and conditionals and data access layer complete. not yet tested