refine steps
add a pseudo code