add overwrite page skip code
tested overwrite page skip
tested clear error code
add write file method
write main method