added new rules and fixed minor buggs