Add more tests and comments