factorized a little the code to do test, and added a new one