Wrote a bunch of tests and added comments