Adding more tests and making it more robust