remove some unusfull codes
fix some errors
add function for plan
fix some errors for plan section