added rules
changed the rules interface
added function headers for AI