simplified input test and made it error-free