Add unit tests and begin commenting functions