simplify a little bit
add a simple test case