trim the code
add testing code
merge