problem 52
add comments and several changes
not solved