Add tests, wrote comments