Added undo button
started adding rules. *working progress*