test cases and validation added