cleaned up code and fixed some rule/scoring issues.