add the first test and improve our code
add the first test and improve our code