move the dependence of class
fix the bug when move left or right
add function to deal with full row
add check for fail