Implemented the test in a better way