Removed bool rules in favor of simpler arrays and added unit testing