Add unit tests and pass them