Carried through evaluate function

also some formatting changes
Started tests

found some bugs from testing