ex4 of hw4 complete but not tested.
working on rule for ex5
everything but ruler works.
added some notes.